package pe.com.itworth.ttsclient.controller;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.RectF;
import android.graphics.Paint.Style;
import android.util.AttributeSet;
import android.widget.FrameLayout;

public class TransparentPanel extends FrameLayout {

	private Paint borderPaint = new Paint();
	private Paint innerPaint=new Paint();
	
	public TransparentPanel(Context context) {
		super(context);
	}
	
	public TransparentPanel(Context context, AttributeSet attributeSet) {
		super(context, attributeSet);
	}
	
//	public TransparentPanel(Context context, AttributeSet attributeSet, int style) {
//		super(context, attributeSet, style);
//	}
	
    protected void dispatchDraw(Canvas canvas) {
        RectF drawRect = new RectF();
        drawRect.set(0,0, getMeasuredWidth(), getMeasuredHeight());

        setFormat();
        canvas.drawRoundRect(drawRect, 5, 5, innerPaint);
        canvas.drawRoundRect(drawRect, 5, 5, borderPaint);

        super.dispatchDraw(canvas);
    }	
    
	public void setFormat(){
    	innerPaint.setARGB(200, 75, 75, 75);
    	borderPaint.setARGB(200, 75, 75, 75);
    	borderPaint.setAntiAlias(true);
    	borderPaint.setStyle(Style.STROKE);
    	borderPaint.setStrokeWidth(2);
    	
    }
	
}
